﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Simple.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="BieuDoGiaVang.BieuDoVang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <h1>
        Biểu đồ giá vàng</h1>
    <asp:Chart ID="chtGiaVang" runat="server" Height="383px" Width="447px">
        <Series>
            <asp:Series Name="GiaMua" ChartArea="MainArea" ChartType="Line" BorderWidth="7" Color="Red">
            </asp:Series>
            <asp:Series Name="GiaBan" ChartArea="MainArea" ChartType="Line" BorderWidth="7" Color="Blue">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="MainArea">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>
    <br />
    <table style="width: 100%;">
        <tr>
            <td>
                Từ:
            </td>
            <td>
                <asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
            </td>
            <td>
                Đến:
            </td>
            <td>
                <asp:TextBox ID="txtTo" runat="server"></asp:TextBox>
            </td>
            <td>
             &nbsp; &nbsp; &nbsp;
            </td>
            <td>
                <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                    onclick="btnUpdate_Click" Width="77px" />
            </td>
        </tr>
    </table>
    <br />
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        DeleteMethod="Delete" InsertMethod="Insert" 
        OldValuesParameterFormatString="original_{0}" 
        onselecting="ObjectDataSource1_Selecting" SelectMethod="GetVangSJCByNgay" 
        TypeName="BieuDoGiaVang.dsGiaVangTableAdapters.VangSJCTableAdapter" 
        UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_Ngay" Type="DateTime" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Ngay" Type="DateTime" />
            <asp:Parameter Name="GiaMua" Type="Decimal" />
            <asp:Parameter Name="GiaBan" Type="Decimal" />
            <asp:Parameter Name="NgayTao" Type="DateTime" />
            <asp:Parameter Name="NgayCapNhat" Type="DateTime" />
        </InsertParameters>
        <SelectParameters>
            <asp:Parameter Name="From" Type="String" />
            <asp:Parameter Name="To" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="GiaMua" Type="Decimal" />
            <asp:Parameter Name="GiaBan" Type="Decimal" />
            <asp:Parameter Name="NgayTao" Type="DateTime" />
            <asp:Parameter Name="NgayCapNhat" Type="DateTime" />
            <asp:Parameter Name="Original_Ngay" Type="DateTime" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <asp:GridView ID="gvGiaVang" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="Ngay" Width="100%">
        <Columns>
            <asp:BoundField DataField="Ngay" DataFormatString="{0:d}" HeaderText="Ngày" 
                ReadOnly="True" SortExpression="Ngay" />
            <asp:BoundField DataField="GiaMua" DataFormatString="{0:###,##0}" 
                HeaderText="Giá mua" SortExpression="GiaMua" >
            <HeaderStyle BackColor="Red" />
            <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="GiaBan" DataFormatString="{0:###,##0}" 
                HeaderText="Giá bán" SortExpression="GiaBan" >
            <HeaderStyle BackColor="Blue" />
            <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
        </Columns>
    </asp:GridView>
</asp:Content>
